package com.yxt.common.sys;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.graphics.Color;

import com.yxt.model.Division;
import com.yxt.model.Valley;

public class CommConstant {	
	public static int screenHeight = 0;
	public static int screenWidth = 0;
	public static boolean DEBUG_MODEL = false;
	
	public static final List<Division> DEFAULT_DIVISIONS = new ArrayList<Division>();
	static {
		DEFAULT_DIVISIONS.add(new Division("全部","-1"));
	}
	
	public static final List<Valley> DEFAULT_VALLEYS = new ArrayList<Valley>();
	static {
		DEFAULT_VALLEYS.add(new Valley("全部","-1"));
	}
	
	/**
	 * 测站查询条件
	 */
	public static final Map<String,String> STATIONTYPE_MAP = new HashMap<String,String>();
	static{
		STATIONTYPE_MAP.put("1", StationType.TYPE_HD);
		STATIONTYPE_MAP.put("2", StationType.TYPE_SK);
		STATIONTYPE_MAP.put("3", StationType.TYPE_YQ);
		STATIONTYPE_MAP.put("4", StationType.TYPE_XQ);
	}
	
	/**
	 * 测站查询条件
	 */
	public static final Map<String,String> STATION_MAP = new HashMap<String,String>();
	static{
		STATION_MAP.put("站名", Station.STATION_NAME);
		STATION_MAP.put("地名", Station.STATION_ADDR);
		STATION_MAP.put("名称", Station.STATION_RIVER);
		STATION_MAP.put("全部", Station.STATION_ALL);
	}
		
	/**
	 * 通讯录查询条件
	 */
	public static final Map<String,String> ADDRESS_MAP = new HashMap<String,String>();
	static{
		ADDRESS_MAP.put("联系人", Address.ADDRESS_NAME);
		ADDRESS_MAP.put("防办部门", Address.ADDRESS_DEPT);
		ADDRESS_MAP.put("单位职务", Address.ADDRESS_DWZW);
		ADDRESS_MAP.put("防办职务", Address.ADDRESS_FBZW);
	}
	
	public static class StationType {
		public final static String TYPE_HD = "河道";
		public final static String TYPE_SK = "水库";
		public final static String TYPE_YQ = "雨情";
		public final static String TYPE_XQ = "咸情";
	}

	public static class Address {
		public final static String ADDRESS_NAME = "name";
		public final static String ADDRESS_DEPT = "departmentid";
		public final static String ADDRESS_DWZW = "job";
		public final static String ADDRESS_FBZW = "sfjob";
	}
	
	/**
	 * 服务器地址
	 * @author crazyman
	 */
	public static class Sever{
		public static String RAIN_SERVER = "";
		public static String WATER_SERVER = "";
		public static String XIAN_SERVER = "";
		public static String SHANG_SERVER = "";
		public static String PROJECT_SERVER = "";
		public static String WEATHER_SERVER = "";
		public static String REPORT_SERVER = "";
		public static String SZREPORT_SERVER = "";		
		public static String YUNTU_SERVER = "";
		public static String RADAR_SERVER = "";
		public static String TFDATA_SERVER = "";
		public static String SEARCH_SERVER = "";
		public static String CONTACTS_SERVER = "";
		public static String KNOWLEDGE_SERVER = "";
	}
	
	public static class Weather {
		public static final String DEFAULT_WEATHER = "http://wap.weather.com.cn/wap/reports/3day.shtml";
		public static final String DEFAULT_QXXX = "http://pda.hydroinfo.gov.cn/PDADownload/Qxxx/qxxx.html";
	}
	
	/**
	 * 测站
	 * @author crazyman
	 */
	public static class Station{		
		public static final int RAIN_LOCATION = 1;
		public static final int WATER_LOCATION = 2;
		public static final int SOIL_LOCATION = 3;
		public static final int SALT_LOCATION = 4;
		
		public final static String STATION_NAME = "name";
		public final static String STATION_ADDR = "addr";
		public final static String STATION_RIVER = "river";
		public final static String STATION_ALL = "";
	}	
	
	/**
	 * 文件路径
	 * @author crazyman
	 *
	 */
	public static class Config {
		public static final String DEFAULT_PHONE_DIR ="/sdcard/android/sqyxt/";
		public static final String DEFAULT_NAME = "全部";
		public static final int DEFAULT_ZOOM = 5;
		public static final int[]  DEFAULT_TABLE_COLORS = new int[] { 0x3000000, 0x300010ff };
		public static final String FUNCTION_XML_LOCATION = "func.xml";
		public static final String DB_LOCATION = "db/";
		public static final String HTML_LOCATION = "html/";
		public static final String PHOTO_LOCATION = "photo/";
		public static final String XML_LOCATION = "xml/";		
		public static final String HELP_LOCATION = "html/main.html";
		public static final String ERROR_FILE_LOCATION = "file:///android_asset/404.html";
		public static final String DEFAULT_DB_LOCATION = "db/FXMobile.db";
		
		public static final String DEFAULT_MAINRIVER_PLACEHOLDER = "basin=";
		public static final String DEFAULT_SUBRIVER_PLACEHOLDER = "ws=";
		public static final String DEFAULT_ITEM_SPLITOR = " ";
		public static final String DEFAULT_AREA_PLACEHOLDER = "area=";
		
		public static final int DEFAULT_TIMEOUT = 10000;
		
		public static final int ADDR_MAXLENGTH = 7;
		public static final int REGION_MAXLENGTH = 5;
		public static final int RIVER_MAXLENGTH = 7;
		public static final int TEMPLATE_MAXLENGTH = 20;
	}
	
	/**
	 * 台风路径常量
	 * @author crazyman
	 */
	public static class Typhoon {
		public static final float[][] POINTS1 = {
			{15.0f,110.0f},
			{22.0f,127.0f},
			{34.0f,127.0f}
		};
		
		public static final float[][] POINTS2 = {
			{15.0f,109.0f},
			{15.0f,125.0f},
			{22.0f,132.0f},
			{34.0f,132.0f},
		};
		

		public static final float[][] DEFAULT_LOCATION = {
			{22.0f,127.0f},
		};
		
		public static final int TYPHOON_FS = 30;
		public static final int TYPHOON_MAX_COUNT = 5;
		
		public static final int TYPHOON_RADIUS = 4;
		
		public static final String MARK24 = "1";
		public static final String MARK48 = "2";
		
		//二十四小时预警
		public static final int COLOR24 = Color.argb(255, 255, 255, 0);
		//四十八小时预警
		public static final int COLOR48 = Color.argb(255, 255, 128, 0);
	}
	
	public static class RemoteFile {
		public final static String NOT_FOUND = "信息不存在";
		public final static int DEFAULT_SUFFIX_LENGHT = 5;
		public final static String DEFAULT_MULTI_SPLITOR = "\\|";
		public final static String DEFAULT_SINGLE_SPLITOR = "@";
	}
	
	
	public static class Photo {
		public final static String DEFAULT_LEIDA_NAME="雷达拼图";
		public final static String DEFAULT_LEIDA_CODE="B4";
		
		public final static String DEFAULT_YUNTU_NAME="卫星云图";
		public final static String DEFAULT_YUNTU_CODE="40";
	}

	/**
	 * 雨情配置信息
	 * @author crazyman
	 */
	public static class Water{		
		public static Map<String,Map<String,String>> WATERMAP = new HashMap<String,Map<String,String>>();
		public static String COUNT_TIME = "";
		
		public final static String HD_TYPE = "1";
		public final static String SK_TYPE = "2";
		public final static String ZB_TYPE = "3";
		public final static String CW_TYPE = "4";

		public final static String WATER_OVER = "1";
		public final static String WATER_ALL = "0";
		
		public final static String DEFAULT_OVER = "-9999.00";
		
		public final static int DEFAULT_MAIN_RIVER = 1;
		public final static int DEFAULT_SUB_RIVER = 2;
		
		public final static String MAIN_TYPE= "1";
		public final static String SUB_TYPE= "2";
		
		public final static String DEFAULT_PALCEHOLDER = "%@";
	}
	
	/**
	 * 雨情配置信息
	 * @author crazyman
	 */
	public static class Rain{
		public final static String ONE_HOUR = "1";
		public final static String THREE_HOUR = "3";
		public final static String SIX_HOUR = "6";
		public final static String DAY_HOUR = "24";
		
		public final static String CHART_TYPE_HOUR = "1";
		public final static String CHART_TYPE_DAY = "0";
		
		public final static String DEFAULT_FILTER = "0";
		public final static String DEFAULT_PLACEHOLDER = "-";
		
		public final static String PROVINCE_TYPE= "0";
		public final static String CITY_TYPE= "1";
		public final static String COUNTY_TYPE= "2";
		
		public final static String RIVER_ALL = "全部";
		
		public static String CALC_TIME = "";
	}

	/**
	 * 功能配置
	 * @author crazyman
	 */
	public static class Main{
		public static Map<String,String> TEMPLATE_MAP = new HashMap<String,String>();
		public static Map<String,Map<String,String>> TEMPLATES = new HashMap<String,Map<String,String>>();
		public static Map<String,Map<String,Map<String,String>>> FUNCTIONS = new HashMap<String,Map<String,Map<String,String>>>();
		public static String CURRENT_TEMPLATE_CODE = "TM00014";
		public static String CURRENT_TEMPLATE_NAME = "通用模板测试";
		public static String CURRENT_AREA_CODE = "450000";		
		public static String CURRENT_AREA_NAME = "广西壮族自治区";		
		public static String CURRENT_RIVER_CODE = "-1";		
		public static String CURRENT_RIVER_NAME = "全部";				
		public static String CURRENT_IPHONE_CODE = "146218D1-FEC9-5008-82CF-EA3FE0B9747F";
		public static String CURRENT_IPHONE_VERSION = "3.07.05";
		
		public static final int DEFAULT_SIX = 6;
		public static final int DEFAULT_NINE = 9;
		public static final int DEFAULT_TWELVE = 12;
		public static final int DEFAULT_ITEM_HEIGHT = 100;
		public static final int DEFAULT_ITEM_COUNT = 3;
		
		public static final int DEFAULT_PROVINCE_TYPE = 2;
		public static final int DEFAULT_CITY_TYPE = 4;
		public static final int DEFAULT_COUNTY_TYPE = 6;

		public static final int DEFAULT_MAIN_TYPE = 1;
		public static final int DEFAULT_SUB_TYPE = 3;
	}
	
	/**
	 * 功能
	 * @author crazyman
	 */
	public static class Function{
		public static final String NODE_FUNCTION = "function";
		public static final String NODE_FUNCTION_ID = "id";
		public static final String NODE_FUNCTION_NAME = "name";
		public static final String NODE_FUNCTION_ICO = "ico";
		public static final String NODE_FUNCTION_CLS = "url";
	}
	
	/**
	 * 登录
	 * @author crazyman
	 */
	public static class Login{
		public static final String APP_KEY = "tongcheng" ;
		public static final String APP_USERNAME = "login.username" ;
		public static final String APP_PASSWORD = "login.password" ;
		public static final String APP_TEMPLATE_CODE = "login.template.code" ;
		public static final String APP_TEMPLATE_NAME = "login.template.name" ;
		public static final String APP_AREA_CODE = "login.area.code" ;
		public static final String APP_AREA_NAME = "login.area.name" ;
		public static final String APP_RIVER_CODE = "login.river.code" ;
		public static final String APP_RIVER_NAME = "login.river.name" ;
		public static final String APP_AUTO_PASSWORD = "auto.password" ;
		public static final String APP_AUTO_LOGIN = "auto.login" ;
	}
	
}